<template>
    <div>
        <!-- 卡片视图 -->
        <el-card>
            <el-col :span="4">
                <el-button type="primary" @click="addDialogVisible = true">添加角色</el-button>
            </el-col>
            <el-table :data="rolesList" border stripe>
                <el-table-column type="index"></el-table-column>
                <el-table-column label="角色名称" prop="rolesName"></el-table-column>
                <el-table-column label="角色描述" prop="roleDesc"></el-table-column>
                <el-table-column label="操作">
                    <template v-slot="scope">
                        <!-- 修改按钮 -->
                        <el-button type="primary" v-model="scope.row.Id">
                            <el-icon>
                                <edit />
                            </el-icon>
                        </el-button>
                        <!-- 删除按钮 -->
                        <el-button type="danger"><el-icon>
                                <delete />
                            </el-icon></el-button>
                        <!-- 分配角色按钮 -->
                        <el-tooltip effect="dark" content="分配角色" placement="top" :enterable="false">
                            <el-button type="warning">
                                <el-icon>
                                    <setting />

                                </el-icon>
                            </el-button>
                        </el-tooltip>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>
    </div>
</template>

<script>

export default {
    data() {
        return {
            //权限列表
            rolesList: [
                {
                    id: 1,
                    rolesName: "炒鸡管理员",
                    roleDesc: '超级无敌管理员',
                },
                {
                    id: 2,
                    rolesName: "教师",
                    roleDesc: '某某老师',
                },
                {
                    id: 1,
                    rolesName: "普通用户",
                    roleDesc: '学员某某某',
                },
                
            ]
        }
    },
    created() {
        //获取所有权限
        this.getRolesList()
    },
    methods: {
        //获取权限列表
        getRolesList() {
            console.log('获取角色列表');
        }
    }
}
</script>